<template>
  <div style="padding: 5px;">
    <a-tabs default-active-key="0" @change="callback">
      <a-tab-pane key="0" tab="封面">
        <coverTable :dataList="dataList"></coverTable>
      </a-tab-pane>
      <a-tab-pane key="1" tab="基本情况表">
        <basicTable :dataList="dataList"></basicTable>
      </a-tab-pane>
      <a-tab-pane key="2" tab="资产清查汇总表">
        <zcqcTable :dataList="dataList"></zcqcTable>
      </a-tab-pane>
      <a-tab-pane key="3" tab="资产清查盘盈处置备案表">
        <zcqcpyczTable :dataList="dataList"></zcqcpyczTable>
      </a-tab-pane>
      <a-tab-pane key="4" tab="资产清查盘损(亏)申请处置审批表">
        <zcqcpkTable :dataList="dataList"></zcqcpkTable>
      </a-tab-pane>
      <a-tab-pane key="5" tab="盘亏原因分析表">
        <pkyyfxTable :dataList="dataList"></pkyyfxTable>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
/*eslint-disable*/
import coverTable from "./components/coverTable/index.vue";
import basicTable from "./components/basicTable/index.vue";
import zcqcTable from "./components/zcqcTable/index.vue";
import zcqcpyczTable from "./components/zcqcpyczTable/index.vue";
import zcqcpkTable from "./components/zcqcpkTable/index.vue";
import pkyyfxTable from "./components/pkyyfxTable/index.vue";
import loadingType from '@/views/DetailPage/mixinsloadingtype'
import {
  getCover,
  getBasic,
  getAdminAssetCheck,
  getAssetProfit,
  getAssetLoss,
  getAnalysis,
} from "@/api/table/index.js";
export default {
  components: {
    coverTable,
    basicTable,
    zcqcTable,
    zcqcpyczTable,
    zcqcpkTable,
    pkyyfxTable,
  },
  props: {
    option: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  mixins:[loadingType],
  data() {
    return {
      dataList: [],
    };
  },

  created() {
    this.getCover();
  },
  methods: {
    //获取封面数据

    getCover() {
      this.dataList = [];
      getCover({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList.push(res.data);
        }
      });
    },
    // 获取基本信息情况表

    getBasic() {
      this.dataList = [];
      getBasic({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList.push(res.data);
          // eslint-disable-next-line no-empty
        } else {
        }
      });
    },
    // 获取资产清查汇总表

    getAdminAssetCheck() {
      this.dataList = [];
      getAdminAssetCheck({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList = res.data;
          // eslint-disable-next-line no-empty
        } else {
        }
      });
    },
    // 柯桥行政事业单位资产清查盘盈处置备案表

    getAssetProfit() {
      this.dataList = [];
      getAssetProfit({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList = res.data;
          // eslint-disable-next-line no-empty
        } else {
        }
      });
    },
    // 盘亏

    getAssetLoss() {
      this.dataList = [];
      getAssetLoss({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList = res.data;
          // eslint-disable-next-line no-empty
        } else {
        }
      });
    },
    //盘亏分析

    getAnalysis() {
      this.dataList = [];
      getAnalysis({
        formGuid: this.$route.query.formGuid,
      }).then((res) => {
        if (res.success) {
          this.dataList = res.data;
          // eslint-disable-next-line no-empty
        } else {
        }
      });
    },

    async callback(index) {
      this.dataList = [];
      if (index == 0) {
        await this.getCover();
      } else if (index == 1) {
        await this.getBasic();
      } else if (index == 2) {
        await this.getAdminAssetCheck();
      } else if (index == 3) {
        await this.getAssetProfit();
      } else if (index == 4) {
        await this.getAssetLoss();
      } else if (index == 5) {
        await this.getAnalysis();
      }

      // this.$emit("loadingType", false);
      this.dataLoadingType = false
      this.headLoadingType = false
    },
  },
};
</script>

<style></style>
